package ac.svn.accesscontrol.ui.helper.formatter;

import ac.svn.accesscontrol.store.SVNUser;
import ac.svn.accesscontrol.ui.IListItemTextFormatter;

public class UserWithGroupTextFormatter implements IListItemTextFormatter {

	@Override
	public String formatString(Object msgObj) {
		SVNUser svnUser = (SVNUser) msgObj;
		String text = String.format("<HTML><b>%s </b>[%s]" +
														"<br>Groups %s ", 
														svnUser.getUserName(),
														svnUser.getUserAlias(),
														svnUser.getGroups().toString());
		return text;
	}

	@Override
	public String formatToolTip(Object msgObject) {
		return formatString(msgObject);
	}

}
